//
// Created by dddgzc on 2025/1/24.
//

#ifndef VECTOR2_H
#define VECTOR2_H
#include <math.h>

class Vector2 {
public:
    float x;
    float y;
public:
    Vector2() = default;
    ~Vector2() = default;
    Vector2(float x, float y);

    Vector2 operator+(const Vector2& vec) const;
    void operator+=(const Vector2& vec);
    void operator-=(const Vector2& vec);
    Vector2 operator-(const Vector2& vec) const;
    float operator*(const Vector2& vec) const;
    Vector2 operator*(float val) const;
    void operator*=(float val);

    float length() const;
    Vector2 normalized() const;
};



#endif //VECTOR2_H
